package com.ruoyi.report.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * CPA报告
 * @TableName walmart_cpa_report
 */
@TableName(value ="walmart_cpa_report")
@Data
public class WalmartCpaReport implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)  // 设置主键和主键策略
    private Long id;
    /**
     * SKU
     */
    @TableField(value = "sku")
    private String sku;

    /**
     * SKU OPT IN
     */
    @TableField(value = "sku_opt_in")
    private String skuOptIn;

    /**
     * 产品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 货币
     */
    @TableField(value = "currency")
    private String currency;

    /**
     * 价格
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 运输价格
     */
    @TableField(value = "ship_price")
    private BigDecimal shipPrice;

    /**
     * 唯一请求id
     */
    @TableField(value = "request_id")
    private String requestId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WalmartCpaReport other = (WalmartCpaReport) that;
        return (this.getSku() == null ? other.getSku() == null : this.getSku().equals(other.getSku()))
            && (this.getSkuOptIn() == null ? other.getSkuOptIn() == null : this.getSkuOptIn().equals(other.getSkuOptIn()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getCurrency() == null ? other.getCurrency() == null : this.getCurrency().equals(other.getCurrency()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getShipPrice() == null ? other.getShipPrice() == null : this.getShipPrice().equals(other.getShipPrice()))
            && (this.getRequestId() == null ? other.getRequestId() == null : this.getRequestId().equals(other.getRequestId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSku() == null) ? 0 : getSku().hashCode());
        result = prime * result + ((getSkuOptIn() == null) ? 0 : getSkuOptIn().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getCurrency() == null) ? 0 : getCurrency().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getShipPrice() == null) ? 0 : getShipPrice().hashCode());
        result = prime * result + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", sku=").append(sku);
        sb.append(", skuOptIn=").append(skuOptIn);
        sb.append(", productName=").append(productName);
        sb.append(", currency=").append(currency);
        sb.append(", price=").append(price);
        sb.append(", shipPrice=").append(shipPrice);
        sb.append(", requestId=").append(requestId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}